<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增液氮')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-ncYedan-add">
		<div class="form-group">
			<label class="col-sm-3 control-label">入库时间：</label>
			<div class="col-sm-8">
				<input id="createTime" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" name="createTime" required
					   th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd hh:mm:ss')}" class="form-control"
					   type="text" th:class="time-input">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">来源：</label>
			<div class="col-sm-8">
				<input id="comeFrom" name="comeFrom" class="form-control" type="text">
			</div>
		</div>
		<!--	<div class="form-group">
				<label class="col-sm-3 control-label">库存(升)：</label>
				<div class="col-sm-8">
					<input id="stockAmout" name="stockAmout" class="form-control" type="text">
				</div>
			</div>-->
		<div class="form-group">
			<label class="col-sm-3 control-label">入库数量(升)：</label>
			<div class="col-sm-8">
				<input id="inputAmount" name="inputAmount" class="form-control" type="number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">采购人：</label>
			<div class="col-sm-8">
				<select id="purchaser" name="purchaser" class="form-control select2-multiple">
					<option th:each="user:${users}" th:value="${user.loginName}" th:text="${user.loginName}"></option>
				</select>
			</div>
		</div>



		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<textarea rows="4" name="remark"  class="form-control" type="text"></textarea>
			</div>
		</div>
	</form>
</div>
<div th:include="include::footer"></div>
<th:block th:include="include :: select2-js" />
<script type="text/javascript">
	var prefix = ctx + "system/ncYedan"
	$("#form-ncYedan-add").validate({
        rules: {
            inputAmount: {
                required: true,
                digits: true
            }

        },
        messages: {
            inputAmount: "入库数必须为正整数"
        },
        focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/add", $('#form-ncYedan-add').serialize());
		}
	}



	/*用户管理-新增-选择部门树*/
	function selectDeptTree() {
		var treeId = $("#treeId").val();
		var deptId = $.common.isEmpty(treeId) ? "100" : $("#treeId").val();
		var options = {
			title: '选择部门',
			width: "380",
            url : ctx + "system/dept/selectDeptTree/" + deptId + "?level=1&rank=2&"+'parentIds=101,',
			callBack: doSubmit
		};
		$.modal.openOptions(options);
	}

</script>
</body>
</html>
